﻿package development.game;

import state.GameAlert;
import state.GameConstants;
import state.GameControl;
import state.GameForm;
import state.GameGlobal;
import state.GameImage;
import state.Graphics;
import state.Key;
import state.TimerListener;
import state.font.FontManager;
import state.font.ImageText;
import state.socket.DataPackage;
import state.util.GameColor;
import state.util.ImageUtil;
import state.util.NumberUtil;
import state.util.array.StringArray;
import development.Constants;
import development.DrawUtils;
import development.FrmDownloadResource;
import development.Global;
import development.bean.Question;
import development.group.FrmGroupMenu;
import development.group.FrmGroupNapXuAndExchangeGold;
import development.listener.DownloadResourceListener;
import development.socket.ProtocolConstants;

public class FrmAilaTrieuPhuOff extends GameForm implements TimerListener {
  private ImageText text;
  private final int SELECT_TO_ANSWER = 3003;
  private final int SEND_RESULT_AFTER_ANSWER = 3004;
  private final int SEND_QUESTION = 100;
  private final int TRO_GIUP_50 = 101;
  private final int TRO_GIUP_NGUOI_THAN = 102;
  private final int TRO_GIUP_HOI_KHAN_GIA = 103;
  private static final int KHONG_DU_TIEN_SIGNAL = 106;
  private static GameForm singleton;
  private int STATE_SCREEN;
  Question question;
  int timePerQuestion;
  int timedrawlevel;
  int count;
//  int time; nâng cấp
  boolean isSendRequest;
  int obtainScores;
  private int selectedIndexAnswer;
  private boolean isAnswered;
  private GameImage backgroundImg;
  private GameImage questionsBoxImg;
  private GameImage menulevel;
  private GameImage iconTrieuphuImg;
  private GameImage linetop2Img;
  private GameImage questionBoxImg;
  private GameImage answerBoxImg;
  private GameImage anseredBoxImg;
  private GameImage hoi_khan_gia_Img;
  private GameImage goidien_supportImg;
  private GameImage half_supportImg;
  private int indexHelp;
  private boolean isActiveHelp;
  private GameImage help_friends_bg;
  private GameImage papaImg;
  private GameImage mamaImg;
  private GameImage hangxomImg;
  private GameImage anhzaiImg;
  private GameImage kuemImg;
  private GameImage chigaiImg;
//  private int choosegoidienIndex; Chơi
  private int selectedHelpIndex;
  private int boxHelpIndex;
  private boolean isEndGame;
  private GameImage endgameImg;
  private int level;
  private GameImage buttonImg;
  private GameImage buttonImg1;
  private GameImage boxYKienKhanGiaImg;
  private GameImage confirmAnswerImg;
  private GameImage chuXImg;
  private String[] results;
  private boolean isOk;
  private boolean isboxHelpIndex2;
  private String resultHelpString;
  private boolean[] isUsedHelp;
  private String dapAnDung;
  private boolean isShowResultPerQuestion;
  private boolean[] iscancel;
  private int STATE_QUESTION;
  private int countDrawHelp1;
  private int[] percent;
  private int selectedNguoithanIndex;
  private String[] nguoiThans;
  private GameImage timeAreaImg;
  private int QUESTIONCONTENT_DX;
  private int QUESTIONCONTENT_DY;
  private boolean isErrorData;
  private GameImage[] halfFocusImg;
  private boolean isNotTrue;
  public static GameForm instance() {
    if (singleton == null) {
      singleton = new FrmAilaTrieuPhuOff();
    }
    return singleton;
  }
  
  public void init(java.util.Hashtable parameters) {
	  if (Constants.IS_240x320_SCREEN) {
		  QUESTIONCONTENT_DX = 15;
		  QUESTIONCONTENT_DY = 172;
	  }
	  isSendRequest = false;
	  isAnswered = false;
	  selectedIndexAnswer = 0;
	  timedrawlevel = 0;
	  indexHelp = 0;
	  isActiveHelp = false;
//	  choosegoidienIndex = 0;
	  isOk = true;
	  selectedHelpIndex = 0;
	  boxHelpIndex = 0;
	timePerQuestion = 0;
	STATE_QUESTION = 0;
	selectedNguoithanIndex = 0;
	isNotTrue = false;
	nguoiThans = new String[]{"Papa", "Mama", "Anh zai", "Hàng xóm", "Ku em", "Chị gái"};
	isUsedHelp = new boolean[3];
	for (int i = 0;  i < 3; i ++) {
		isUsedHelp[i] = false;
	}
	level = 0;
	obtainScores = 0;
	isEndGame = false;
	iscancel = new boolean[4];
	percent = new int[4];
	for (int i = 0; i < 4; i ++ ) {
		iscancel[i] = false;
	}
	isErrorData = false;
	results = new String[]{ "A", "B", "C", "D" };
    text = FontManager.getFont(FontManager.FONT_SIZE_8);
    resultHelpString = "";
    STATE_SCREEN = 2;
    questionBoxImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-cau-hoi.png"); // ô ghi câu hỏi
	answerBoxImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-tra-loi.png");
	boxYKienKhanGiaImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-tro-giup-khan-gia.png");
	confirmAnswerImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-xac-nhan-lai.png");
	chuXImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "chu-X.png");
	menulevel = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "cau-hoi-da-tra-loi.png"); // level đang đạt đc
	hoi_khan_gia_Img  = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "khan-gia.png");
	goidien_supportImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "phone.png");
	half_supportImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "50-50.png");
	help_friends_bg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-tro-giup-nguoi-than.png");
	papaImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "papa.png");
	mamaImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "mama.png");
	anhzaiImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "anh-dai.png");
	chigaiImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "chi-gai.png");
	kuemImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "ku-em.png");
	hangxomImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "hang-xom.png");
	endgameImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "end.png");
	buttonImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "button1.png");
	buttonImg1 = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "button2.png");
	anseredBoxImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-tra-loi-lua-chon.png");
	halfFocusImg = new GameImage[3];
	halfFocusImg[0] = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "50-50_focus.png");
	halfFocusImg[1] = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "phone_focus.png");
	halfFocusImg[2] = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "khan-gia_fous.png");
	 if (Constants.IS_240x320_SCREEN) {
	    	backgroundImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "background.png");
	    	questionsBoxImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-cau-hoi-so-tien.png");
			iconTrieuphuImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "1-trieu-phu.png"); // icon
			
			timeAreaImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "time_area.png");
	    } else {
	    	backgroundImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "background_320.png");
	    	questionsBoxImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "box-cau-hoi-so-tien.png");
			iconTrieuphuImg = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "1-trieu-phu.png"); // icon
			linetop2Img = ImageUtil.getImage(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY, "line-top_320.png");
	    }
		
	setTimerListener(this);
	DrawUtils.setBottomBar(_manager, "", "", "Thoát");
	_manager.enableTouchPad();
  }
  
  private void sendRequestQuestion() {
	  DataPackage dataPackage = DataPackage.createDataPackage1(ProtocolConstants.RequestHeader.GAME_AI_LA_TRIEU_PHU_OFF_ACTION_REQUEST);
		    dataPackage.putInt(SEND_QUESTION);
		    dataPackage.putInt(level);
		    Global.gameActionClient.write(dataPackage);
  }
  
	public void draw(Graphics g) {
		g.drawImage(backgroundImg, 0, 0, GameConstants.TOP_LEFT_ANCHOR);
		if (Constants.IS_240x320_SCREEN) {
			if (STATE_SCREEN == 1) {
					drawbackground(g);
					drawLevel(g);
					drawQuestion(g);
				if (isActiveHelp) {
					DrawUtils.getBottomBar(_manager).setLeftLabel("Bỏ qua");
				} else {
					DrawUtils.getBottomBar(_manager).setLeftLabel("Trợ giúp");
				}
			} else if (STATE_SCREEN == 2) {
				drawLevel(g);
				drawbackground(g);
			} /*else if (STATE_SCREEN == 4) {
				drawConfirm(g, "Bạn không đủ tiền để chơi game.", false);
			}*/
		} else {
			if (STATE_SCREEN == 1) {
				drawGround_320(g);
				drawQuestion_320(g);
				if (isActiveHelp) {
					DrawUtils.getBottomBar(_manager).setLeftLabel("Bỏ qua");
				} else {
					DrawUtils.getBottomBar(_manager).setLeftLabel("Trợ giúp");
				}
			} else if (STATE_SCREEN == 2) {
				drawGround_320(g);
			} /*else if (STATE_SCREEN == 4) {
				drawConfirm(g, "Bạn không đủ tiền để chơi game.", false);
			}*/
		}
		if (isEndGame) {
			drawLevel(g);
			drawEndGame(g);
		}
	}
  public void drawEndGame(Graphics g) {
	  g.drawImage(endgameImg, Constants.SCREEN_WIDTH / 2, Constants.SCREEN_HEIGHT / 2, GameConstants.CENTER_ANCHOR);
	  DrawUtils.getBottomBar(_manager).setCenterLabel("Chơi lại");
  }
  public void drawbackground(Graphics g) {
	  g.drawImage(iconTrieuphuImg, Constants.SCREEN_WIDTH/2, 102, GameConstants.CENTER_ANCHOR);
	  g.drawImage(half_supportImg, 6, 48, GameConstants.TOP_LEFT_ANCHOR);
	  g.drawImage(goidien_supportImg, 6, 88, GameConstants.TOP_LEFT_ANCHOR);
	  g.drawImage(hoi_khan_gia_Img, 6, 128, GameConstants.TOP_LEFT_ANCHOR);
	  if (isActiveHelp) {
		  if (selectedHelpIndex == 0 /*|| selectedHelpIndex == 10*/) {
			  g.drawImage(halfFocusImg[indexHelp], 6, 49 + indexHelp * 40, GameConstants.TOP_LEFT_ANCHOR);
//			  g.drawRoundRect(5, 48 + indexHelp * 39, 30, 30, 20, 20);
		  }
	  }
	  if (isUsedHelp[0]) {
		  g.drawImage(chuXImg, 28, 66, GameConstants.CENTER_ANCHOR);
	  }
	  if (isUsedHelp[1]) {
		  g.drawImage(chuXImg, 28, 104, GameConstants.CENTER_ANCHOR);
	  }
	  if (isUsedHelp[2]) {
		  g.drawImage(chuXImg, 28, 143, GameConstants.CENTER_ANCHOR);
	  }
	  if (Constants.IS_240x320_SCREEN) {
		  g.drawImage(timeAreaImg, 12, 8, Constants.TOP_LEFT_ANCHOR);
	  } else {
		  g.drawImage(linetop2Img, GameConstants.SCREEN_WIDTH/2, 26, GameConstants.CENTER_ANCHOR);
	  }
	  
	  if (!isActiveHelp) {
		  DrawUtils.getBottomBar(_manager).setLeftLabel("Trợ giúp");
	  } else {
		  DrawUtils.getBottomBar(_manager).setLeftLabel("Bỏ qua");
	  }
  }
  public void drawQuestion0_240(Graphics g) {
	
	  if (question != null) {
		  g.drawImage(questionBoxImg, Constants.SCREEN_WIDTH/2, QUESTIONCONTENT_DY, GameConstants.TOP_HCENTER_ANCHOR);
		  if (!isShowResultPerQuestion) {
			  text.drawParagraph1(g, question.getContent(), GameColor.YELLOW_CODE, GameConstants.SCREEN_WIDTH - 40, -5, QUESTIONCONTENT_DX, QUESTIONCONTENT_DY);
		  }
		  g.drawImage(answerBoxImg, 7, 228, GameConstants.TOP_LEFT_ANCHOR);
		  g.drawImage(answerBoxImg, 7, 260, GameConstants.TOP_LEFT_ANCHOR);
		  g.drawImage(answerBoxImg, GameConstants.SCREEN_WIDTH/2 + 10, 228, GameConstants.TOP_LEFT_ANCHOR);
		  g.drawImage(answerBoxImg, GameConstants.SCREEN_WIDTH/2 + 10, 260, GameConstants.TOP_LEFT_ANCHOR);
		  if (selectedIndexAnswer == 0) {
			  g.drawImage(anseredBoxImg, 6, 227, GameConstants.TOP_LEFT_ANCHOR);
		  } else if (selectedIndexAnswer == 1) {
			  g.drawImage(anseredBoxImg, 129, 227, GameConstants.TOP_LEFT_ANCHOR);
		  } else if (selectedIndexAnswer == 2) {
			  g.drawImage(anseredBoxImg, 6, 259, GameConstants.TOP_LEFT_ANCHOR);
		  } else if (selectedIndexAnswer == 3) {
			  g.drawImage(anseredBoxImg, 129, 259, GameConstants.TOP_LEFT_ANCHOR);
		  }
		  if (!iscancel[0]) {
			  int color = GameColor.WHITE_CODE;
			  if (selectedIndexAnswer == 0) {
				  color = GameColor.YELLOW_CODE;
			  }
			  text.drawParagraph1(g, question.getResult1(), color, 98, -5, 12, 227);
		  }
		  if (!iscancel[1]) {
			  int color = GameColor.WHITE_CODE;
			  if (selectedIndexAnswer == 1) {
				  color = GameColor.YELLOW_CODE;
			  }
			  text.drawParagraph1(g, question.getResult2(), color, 98, -5, 135, 227);
		  }
		  if (!iscancel[2]) {
			  int color = GameColor.WHITE_CODE;
			  if (selectedIndexAnswer == 2) {
				  color = GameColor.YELLOW_CODE;
			  }
			  text.drawParagraph1(g, question.getResult3(), color, 98, -5, 12, 259);
		  }
		  if (!iscancel[3]) {
			  int color = GameColor.WHITE_CODE;
			  if (selectedIndexAnswer == 3) {
				  color = GameColor.YELLOW_CODE;
			  }
			  text.drawParagraph1(g, question.getResult4(), color, 98, -5, 135, 259);
		  }
	  }
	  text.drawString2(g, "00:" + timePerQuestion, GameColor.BLUE_CODE, 14,  15, GameConstants.TOP_LEFT_ANCHOR);
	  if (isShowResultPerQuestion) {
		  if (!isEndGame){
			  if (!isNotTrue) {
				  text.drawString2(g, "Đáp án là " + dapAnDung, GameColor.WHITE_CODE, GameConstants.SCREEN_WIDTH / 2, QUESTIONCONTENT_DY + 10, GameConstants.CENTER_ANCHOR);
				  text.drawString2(g, "Chúc mừng bạn đã trả lời đúng ", GameColor.WHITE_CODE, GameConstants.SCREEN_WIDTH / 2, QUESTIONCONTENT_DY + 25, GameConstants.CENTER_ANCHOR);
			  } else {
				  text.drawString2(g, "Câu trả lời của bạn không đúng", GameColor.WHITE_CODE, GameConstants.SCREEN_WIDTH / 2, QUESTIONCONTENT_DY + 10, GameConstants.CENTER_ANCHOR);
				  text.drawString2(g, "Đáp án là " + dapAnDung, GameColor.WHITE_CODE, GameConstants.SCREEN_WIDTH / 2, QUESTIONCONTENT_DY + 25, GameConstants.CENTER_ANCHOR);
			  }
		  }
	  }
  }
  public void drawQuestion(Graphics g) {
	  if (!isErrorData) {
		  drawQuestion0_240(g);
		  drawUseHelp(g);
		  if (STATE_QUESTION == 0) {
		  } else if (STATE_QUESTION == 1) {
			  drawConfirm(g, "" + results[selectedIndexAnswer] + " là đáp án cuối cùng của bạn?", true);
		  } else if (STATE_QUESTION == 22) {
			  drawHelpFromFriends(g);
		  } else if (STATE_QUESTION == 23) {
			  drawHoiKhanGia(g, 40, 53);
		  } else if (STATE_QUESTION == 21){
			  if (countDrawHelp1 < 3) {
				  drawConfirm(g, "Hệ thống bỏ đi 2 đáp án sai "  + resultHelpString, false);
			  } else {
				  isActiveHelp = false;
				  STATE_QUESTION = 0;
				  selectedHelpIndex = 0;
			  }
		  } else {
		  }
	  } else {
		  drawConfirm(g, "Lỗi dữ liệu! Mời bạn trở về sau.", false);
	  }
  }
  public void drawQuestion_320(Graphics g) {
	  drawGround_320(g);
	  drawInfoQuestion_320(g);
	  drawUseHelp(g);
	  if (STATE_QUESTION == 0) {
	  } else if (STATE_QUESTION == 1) {
		  drawConfirm(g, "" + results[selectedIndexAnswer] + " là đáp án cuối cùng của bạn?", true);
	  } else if (STATE_QUESTION == 22) {
		  drawHelpFromFriends(g);
	  } else if (STATE_QUESTION == 23) {
		  drawHoiKhanGia(g, 80, 53);
	  } else if (STATE_QUESTION == 21){
		  if (countDrawHelp1 < 3) {
			  drawConfirm(g, "Hệ thống bỏ đi 2 đáp án sai "  + resultHelpString, false);
		  } else {
			  isActiveHelp = false;
			  STATE_QUESTION = 0;
		  }
	  } 
  }
  
  public void drawHoiKhanGia(Graphics g, int x, int y) {
	  g.drawImage(boxYKienKhanGiaImg, x, y, GameConstants.TOP_LEFT_ANCHOR);
	  g.drawImage(buttonImg, x + 45, y + 145, GameConstants.TOP_LEFT_ANCHOR);
	  text.drawString2(g, "OK", GameColor.WHITE_CODE, x + 80, y + 155, GameConstants.CENTER_ANCHOR);
	  g.setColor(GameColor.YELLOW_CODE);
	  g.fillRect(x + 25, y + 120 - (percent[0] * 90)/100, 18, (percent[0] * 90)/100);
	  g.fillRect(x + 25 + 30, y + 120 - (percent[1] * 90)/100, 18, (percent[1] * 90)/100);
	  g.fillRect(x + 25 + 60, y + 120 - (percent[2] * 90)/100, 18, (percent[2] * 90)/100);
	  g.fillRect(x + 25 + 90, y + 120 - (percent[3] * 90)/100, 18, (percent[3] * 90)/100);
	  text.drawString2(g, percent[0] + "%", GameColor.WHITE_CODE, x + 35, y + 105 - (percent[0] * 90)/100, GameConstants.CENTER_ANCHOR);
	  text.drawString2(g, percent[1] + "%", GameColor.WHITE_CODE, x + 25 + 40, y + 105 - (percent[1] * 90)/100, GameConstants.CENTER_ANCHOR);
	  text.drawString2(g, percent[2] + "%", GameColor.WHITE_CODE, x + 25 + 70, y + 105 - (percent[2] * 90)/100, GameConstants.CENTER_ANCHOR);
	  text.drawString2(g, percent[3] + "%", GameColor.WHITE_CODE, x + 25 + 100, y + 105 - (percent[3] * 90)/100, GameConstants.CENTER_ANCHOR);
  }
  public void drawUseHelp(Graphics g) {
	  if (isActiveHelp) {
		  if (selectedHelpIndex == 1) {
			  if (!isUsedHelp[0]) {
				  drawConfirm(g, "Bạn chắc chắn dùng trợ giúp 50/50?", true);
				  STATE_QUESTION = 3;
			  }
		  } else if (selectedHelpIndex == 2) {
			  if (!isUsedHelp[1]) {
				  drawConfirm(g, "Bạn chắc chắn hỏi người thân?", true);
				  STATE_QUESTION = 3;
			  }
		  } else if (selectedHelpIndex == 3) {
			  if (!isUsedHelp[2]) {
				  drawConfirm(g, "Bạn chắc chắn muốn hỏi khán giả?", true);
				  STATE_QUESTION = 3;
			  }
		  }
	  }
  }
  public void drawGround_320(Graphics g) {
	  drawLevel(g);
	  g.drawImage(iconTrieuphuImg, Constants.SCREEN_WIDTH/2, 75, GameConstants.CENTER_ANCHOR);
	  g.drawImage(linetop2Img, GameConstants.SCREEN_WIDTH/2, 26, GameConstants.CENTER_ANCHOR);
	  g.drawImage(half_supportImg, Constants.SCREEN_WIDTH/2 - 39, 26, GameConstants.CENTER_ANCHOR);
	  g.drawImage(goidien_supportImg, Constants.SCREEN_WIDTH/2, 26, GameConstants.CENTER_ANCHOR);
	  g.drawImage(hoi_khan_gia_Img, Constants.SCREEN_WIDTH/2 + 39, 26, GameConstants.CENTER_ANCHOR);
	  if (isActiveHelp && selectedHelpIndex == 0) {
		  g.drawImage(halfFocusImg[indexHelp], Constants.SCREEN_WIDTH/2 + (indexHelp - 1) * 39 - 20, 5, GameConstants.TOP_LEFT_ANCHOR);
//		  g.drawRoundRect(Constants.SCREEN_WIDTH/2 + (indexHelp - 1) * 39 - 15, 16, 30, 30, 20, 20);
	  }
	  
	  if (isUsedHelp[0]) {
		  g.drawImage(chuXImg, Constants.SCREEN_WIDTH/2 - 39, 26, GameConstants.CENTER_ANCHOR);
	  }
	  
	  if (isUsedHelp[1]) {
		  g.drawImage(chuXImg, Constants.SCREEN_WIDTH/2, 26, GameConstants.CENTER_ANCHOR);
	  }
	  if (isUsedHelp[2]) {
		  g.drawImage(chuXImg, Constants.SCREEN_WIDTH/2 + 39, 26, GameConstants.CENTER_ANCHOR);
	  }
	 

	  text.drawString2(g, String.valueOf(level), GameColor.BLUE_CODE, 50, 26, GameConstants.VCENTER_LEFT_ANCHOR);
	  text.drawString2(g, "00:" + timePerQuestion, GameColor.BLUE_CODE, 230,  26, GameConstants.VCENTER_LEFT_ANCHOR);
	  if (!isActiveHelp) {
		  DrawUtils.getBottomBar(_manager).setLeftLabel("Trợ giúp");
	  } else {
		  DrawUtils.getBottomBar(_manager).setLeftLabel("Bỏ qua");
	  }
	 
  }
  
  public void drawInfoQuestion_320(Graphics g) {
	  if (!isErrorData) {
		  if (question != null) {
			  g.drawImage(questionBoxImg, 10, 71, GameConstants.TOP_LEFT_ANCHOR);
			  if (!isShowResultPerQuestion) { 
				  text.drawParagraph1(g, question.getContent(), GameColor.YELLOW_CODE, 200, -5, 15, 72);
			  }
			  if (selectedIndexAnswer == 0) {
				  g.drawImage(anseredBoxImg, 6, 135, GameConstants.TOP_LEFT_ANCHOR);
			  } else if (selectedIndexAnswer == 1) {
				  g.drawImage(anseredBoxImg,126, 135, GameConstants.TOP_LEFT_ANCHOR);
			  } else if (selectedIndexAnswer == 2) {
				  g.drawImage(anseredBoxImg, 6, 175, GameConstants.TOP_LEFT_ANCHOR);
			  } else if (selectedIndexAnswer == 3) {
				  g.drawImage(anseredBoxImg, 126, 175, GameConstants.TOP_LEFT_ANCHOR);
			  }
			  g.drawImage(answerBoxImg, 7, 136, GameConstants.TOP_LEFT_ANCHOR);
			  g.drawImage(answerBoxImg, 7, 176, GameConstants.TOP_LEFT_ANCHOR);
			  g.drawImage(answerBoxImg, 127, 136, GameConstants.TOP_LEFT_ANCHOR);
			  g.drawImage(answerBoxImg, 127, 176, GameConstants.TOP_LEFT_ANCHOR);
			  if (!iscancel[0]) {
				  int color = GameColor.WHITE_CODE;
				  if (selectedIndexAnswer == 0) {
					  color = GameColor.YELLOW_CODE;
				  }
				  text.drawParagraph1(g, question.getResult1(), color, 98, -5, 11, 135);
			  }
			  if (!iscancel[1]) {
				  int color = GameColor.WHITE_CODE;
				  if (selectedIndexAnswer == 1) {
					  color = GameColor.YELLOW_CODE;
				  }
				  text.drawParagraph1(g, question.getResult2(), color, 98, -5, 130, 135);
			  }
			  if (!iscancel[2]) {
				  int color = GameColor.WHITE_CODE;
				  if (selectedIndexAnswer == 2) {
					  color = GameColor.YELLOW_CODE;
				  }
				  text.drawParagraph1(g, question.getResult3(), color, 98, -5, 11, 172);
			  }
			  if (!iscancel[3]) {
				  int color = GameColor.WHITE_CODE;
				  if (selectedIndexAnswer == 3) {
					  color = GameColor.YELLOW_CODE;
				  }
				  if (!question.getResult4().trim().equals("") && question.getResult4() != null)
				  text.drawParagraph1(g, question.getResult4(), color, 98, -5, 130, 172);
			  }
			  
			  if (isShowResultPerQuestion) {
				  if (!isEndGame){
					  if (!isNotTrue) {
						  text.drawString2(g, "Đáp án là " + dapAnDung, GameColor.WHITE_CODE, 120, 85, GameConstants.CENTER_ANCHOR);
						  text.drawString2(g, "Chúc mừng bạn đã trả lời đúng ", GameColor.WHITE_CODE, 120, 100, GameConstants.CENTER_ANCHOR);
					  } else {
						  text.drawString2(g, "Câu trả lời của bạn không đúng", GameColor.WHITE_CODE, 120, 85, GameConstants.CENTER_ANCHOR);
						  text.drawString2(g, "Đáp án là " + dapAnDung, GameColor.WHITE_CODE, 120, 100, GameConstants.CENTER_ANCHOR);
					  }
				  }
			  }
		  }
	  } else {
		  drawConfirm(g, "Lỗi dữ liệu! Mời bạn trở về sau", false);
	  }
	  
  }
  public void drawConfirm(Graphics g, String s, boolean isHasButton) {
	  g.drawImage(confirmAnswerImg, GameConstants.SCREEN_WIDTH / 2, 146, GameConstants.CENTER_ANCHOR);
	  text.drawString2(g, s + "", GameColor.YELLOW_CODE, GameConstants.SCREEN_WIDTH / 2, 127, GameConstants.CENTER_ANCHOR);
	  if (isHasButton) {
		  if (isOk) {
			  g.drawImage(buttonImg1, GameConstants.SCREEN_WIDTH / 2 - 20, 153, GameConstants.VCENTER_RIGHT_ANCHOR);
			  g.drawImage(buttonImg, GameConstants.SCREEN_WIDTH / 2 + 20, 153, GameConstants.VCENTER_LEFT_ANCHOR);
		  } else {
			  g.drawImage(buttonImg, GameConstants.SCREEN_WIDTH / 2 - 20, 153, GameConstants.VCENTER_RIGHT_ANCHOR);
			  g.drawImage(buttonImg1, GameConstants.SCREEN_WIDTH / 2 + 20, 153, GameConstants.VCENTER_LEFT_ANCHOR);
		  }
//		  g.drawImage(buttonImg, GameConstants.SCREEN_WIDTH / 2 - 20, 153, GameConstants.VCENTER_RIGHT_ANCHOR);
//		  g.drawImage(buttonImg1, GameConstants.SCREEN_WIDTH / 2 + 20, 153, GameConstants.VCENTER_LEFT_ANCHOR);
		  text.drawString2(g, "Đồng ý", GameColor.WHITE_CODE, GameConstants.SCREEN_WIDTH / 2 - 35, 153, GameConstants.VCENTER_RIGHT_ANCHOR);
		  text.drawString2(g, "Hủy", GameColor.WHITE_CODE, GameConstants.SCREEN_WIDTH / 2 + 40, 153, GameConstants.VCENTER_LEFT_ANCHOR);
	  }
  }
  
  public void drawLevel(Graphics g) {
	  if (Constants.IS_240x320_SCREEN) {
		  g.drawImage(questionsBoxImg, Constants.SCREEN_WIDTH - 3, 0, Constants.TOP_RIGHT_ANCHOR);
		  g.drawImage(menulevel, Constants.SCREEN_WIDTH - 3, 169 - (level * 11), Constants.BOTTOM_RIGHT_ANCHOR);
	  } else {
		  g.drawImage(questionsBoxImg, Constants.SCREEN_WIDTH - 10, 3 + 35, Constants.TOP_RIGHT_ANCHOR);
		  g.drawImage(menulevel, Constants.SCREEN_WIDTH - 10, 207 - (level * 11), Constants.BOTTOM_RIGHT_ANCHOR);
	  }
  }
  public void drawHelpFromFriends(Graphics g) {
	  if (!isboxHelpIndex2) {
		  g.drawImage(help_friends_bg, Constants.SCREEN_WIDTH /2, Constants.SCREEN_HEIGHT /2 - 10, Constants.CENTER_ANCHOR);
		  text.drawString2(g, "Mời chọn trợ giúp người thân", GameColor.YELLOW_CODE, Constants.SCREEN_WIDTH /2, 83, Constants.CENTER_ANCHOR);
		  g.drawImage(papaImg, Constants.SCREEN_WIDTH / 2 - 68, Constants.SCREEN_HEIGHT/2 - 10, Constants.BOTTOM_HCENTER_ANCHOR);
		  g.drawImage(mamaImg, Constants.SCREEN_WIDTH / 2, Constants.SCREEN_HEIGHT/2 - 10, Constants.BOTTOM_HCENTER_ANCHOR);
		  g.drawImage(anhzaiImg, Constants.SCREEN_WIDTH / 2 + 68, Constants.SCREEN_HEIGHT/2 - 10, Constants.BOTTOM_HCENTER_ANCHOR);
		  g.drawImage(hangxomImg, Constants.SCREEN_WIDTH / 2 - 68 , Constants.SCREEN_HEIGHT/2 - 5, Constants.TOP_HCENTER_ANCHOR);
		  g.drawImage(kuemImg, Constants.SCREEN_WIDTH / 2,  Constants.SCREEN_HEIGHT/2 - 5, Constants.TOP_HCENTER_ANCHOR);
		  g.drawImage(chigaiImg, Constants.SCREEN_WIDTH / 2 + 68 , Constants.SCREEN_HEIGHT/2 - 5, Constants.TOP_HCENTER_ANCHOR);
		  if (selectedNguoithanIndex == 0) {
			  g.drawImage(papaImg, Constants.SCREEN_WIDTH / 2 - 70, Constants.SCREEN_HEIGHT/2 - 10, Constants.BOTTOM_HCENTER_ANCHOR);
		  } else if (selectedNguoithanIndex == 1) {
			  g.drawImage(mamaImg, Constants.SCREEN_WIDTH / 2, Constants.SCREEN_HEIGHT/2 - 8, Constants.BOTTOM_HCENTER_ANCHOR);
		  } else if (selectedNguoithanIndex == 2) {
			  g.drawImage(anhzaiImg, Constants.SCREEN_WIDTH / 2 + 70, Constants.SCREEN_HEIGHT/2 - 10, Constants.BOTTOM_HCENTER_ANCHOR);
		  } else if (selectedNguoithanIndex == 3) {
			  g.drawImage(hangxomImg, Constants.SCREEN_WIDTH / 2 - 70 , Constants.SCREEN_HEIGHT/2 - 5, Constants.TOP_HCENTER_ANCHOR);
		  } else if (selectedNguoithanIndex == 4) {
			  g.drawImage(kuemImg, Constants.SCREEN_WIDTH / 2,  Constants.SCREEN_HEIGHT/2 - 8, Constants.TOP_HCENTER_ANCHOR);
		  } else if (selectedNguoithanIndex == 5) {
			  g.drawImage(chigaiImg, Constants.SCREEN_WIDTH / 2 + 70 , Constants.SCREEN_HEIGHT/2 - 5, Constants.TOP_HCENTER_ANCHOR);
		  } 
	  } else {
		  drawConfirm(g, nguoiThans[selectedNguoithanIndex] + " khuyên bạn chọn đáp án:" + resultHelpString, true);
	  }
  }
  public void keyReleased(int keyCode) {
    if (keyCode == Key.SOFT_RIGHT) {
      Global.nextState(FrmGroupMenu.instance(), null);
      return;
    }
   
    switch (keyCode) {
	case Key.RIGHT:
		if (isActiveHelp) {
			if (STATE_QUESTION == 0) {
				if (!Constants.IS_240x320_SCREEN) {
					indexHelp = (indexHelp + 1) % 3;
				}
			} else if (STATE_QUESTION == 22) {
				selectedNguoithanIndex = (selectedNguoithanIndex + 1) % 6;
			}
		}  else if (STATE_QUESTION == 1 || STATE_QUESTION == 3 || STATE_QUESTION == 2) {
			isOk = !isOk;
		}  else if (STATE_QUESTION == 0) {
			if (!isAnswered) {
				selectedIndexAnswer = (selectedIndexAnswer + 1) %4;
			}
		}
		break;
	case Key.LEFT:
		if (isActiveHelp) {
			if (STATE_QUESTION == 0) {
				if (!Constants.IS_240x320_SCREEN) {
					indexHelp --;
					if (indexHelp < 0) {
						indexHelp = 2;
					}
				}
			} else if (STATE_QUESTION == 22) {
				selectedNguoithanIndex --;
				if (selectedNguoithanIndex < 0) {
					selectedNguoithanIndex = 5;
				}
				//selectedNguoithanIndex = (selectedNguoithanIndex + 1) % 6;
			} 
		}  else if (STATE_QUESTION == 1 || STATE_QUESTION == 3 || STATE_QUESTION == 2) {
			isOk = !isOk;
		} else if (STATE_QUESTION == 0) {
			if (!isAnswered) {
				selectedIndexAnswer -= 1;
				if (selectedIndexAnswer < 0) {
					selectedIndexAnswer = 3;
				}
			}
		}
		break;
	case Key.DOWN:
		if (Constants.IS_240x320_SCREEN) {
			if (isActiveHelp) {
				indexHelp = (indexHelp + 1) % 3;
				
			} else {
				if (!isAnswered && STATE_QUESTION == 0) {
					selectedIndexAnswer = (selectedIndexAnswer + 1) %4;
				}
			}
		} else {
			if (!isAnswered && STATE_QUESTION == 0) {
				selectedIndexAnswer = (selectedIndexAnswer + 1) %4;
			}
		}
		break;
	case Key.UP:
		if (Constants.IS_240x320_SCREEN)  {
			if (isActiveHelp) {
				if (STATE_QUESTION == 0) {
					if (selectedHelpIndex == 2) {
						//choosegoidienIndex = (choosegoidienIndex + 1)% 6;
					} else {
						indexHelp --;
						if (indexHelp < 0) {
							indexHelp = 2; 
						}
					}
				}
			} else {
				if (!isAnswered && STATE_QUESTION == 0) {
					selectedIndexAnswer -= 1;
					if (selectedIndexAnswer < 0) {
						selectedIndexAnswer = 3;
					}
				}
			}
		} else {
			if (!isAnswered && STATE_QUESTION == 0) {
				selectedIndexAnswer -= 1;
				if (selectedIndexAnswer < 0) {
					selectedIndexAnswer = 3;
				}
			}
		}
		break;
	case Key.FIRE:
		if (!isEndGame) {
			if (isActiveHelp) {
				if (selectedHelpIndex == 1) {
					if (isOk && !isUsedHelp[0]) {
						sendMessageAction(ProtocolConstants.RequestHeader.GAME_AI_LA_TRIEU_PHU_OFF_ACTION_REQUEST, TRO_GIUP_50, 0);
						selectedHelpIndex = 10;
						isUsedHelp[0] = true;
						boxHelpIndex = 1;
						STATE_QUESTION = 21;
						countDrawHelp1 = 0;
					} else {
						isOk = true;
						STATE_QUESTION = 0;
						isActiveHelp = false;
						selectedHelpIndex = 0;
						isAnswered = false;
					} 
				} else if (selectedHelpIndex == 2) {
					if (isOk && !isUsedHelp[1]) {
						isUsedHelp[1] = true;
						
						selectedHelpIndex = 10;
						boxHelpIndex = 2;
						STATE_QUESTION = 22;
					} else {
						isOk = true;
						STATE_QUESTION = 0;
						isActiveHelp = false;
						selectedHelpIndex = 0;
						isAnswered = false;
					}
				} else if (selectedHelpIndex == 3){
					if (isOk && !isUsedHelp[2]) {
						isUsedHelp[2] = true;
						sendMessageAction(ProtocolConstants.RequestHeader.GAME_AI_LA_TRIEU_PHU_OFF_ACTION_REQUEST, TRO_GIUP_HOI_KHAN_GIA, 0);
						selectedHelpIndex = 10;
						boxHelpIndex = 3;
						STATE_QUESTION = 23;
					} else {
						isOk = true;
						STATE_QUESTION = 0;
						isActiveHelp = false;
						selectedHelpIndex = 0;
						isAnswered = false;
					}
				} else  if (selectedHelpIndex == 0){
					switch (indexHelp) {
					case 0:
						selectedHelpIndex = 1;
						break;
					case 1:
						if (boxHelpIndex == 2) {
							isboxHelpIndex2 = true;
						} else {
							selectedHelpIndex = 2;
						}
						break;
					case 2:
						selectedHelpIndex = 3;
						break;
					}
				} else {
					if (STATE_QUESTION == 23) {
						STATE_QUESTION = 0;
						isActiveHelp = false;
						selectedHelpIndex = 0;
					} else if (STATE_QUESTION == 21) {
						STATE_QUESTION = 0;
						isActiveHelp = false;
						selectedHelpIndex = 0;
					} else if (STATE_QUESTION == 22) {
						if (isboxHelpIndex2 == false) {
							isboxHelpIndex2 = true;
							sendMessageAction(ProtocolConstants.RequestHeader.GAME_AI_LA_TRIEU_PHU_OFF_ACTION_REQUEST, TRO_GIUP_NGUOI_THAN, 0);
						} else {
							STATE_QUESTION = 0;
							isActiveHelp = false;
							selectedHelpIndex = 0;
						}
					}
				}
			} else if (!isAnswered) {
				if (!iscancel[selectedIndexAnswer]) {
					if (STATE_QUESTION != 1) {
						STATE_QUESTION = 1;
					} else {
						if (isOk) {
							isAnswered = true;
							sendMessageAction(ProtocolConstants.RequestHeader.GAME_AI_LA_TRIEU_PHU_OFF_ACTION_REQUEST, SELECT_TO_ANSWER, selectedIndexAnswer);
						} else {
							isOk = true;
							isAnswered = false;
						}
						STATE_QUESTION = 0;
						isActiveHelp = false;
						selectedHelpIndex = 0;
					}
//					isAnswered = true;
//					STATE_QUESTION = 1;
//					STATE_QUESTION = 0;
				}
			} else {
				/*if (isOk) {
					isAnswered = true;
					sendMessageAction(ProtocolConstants.RequestHeader.GAME_AI_LA_TRIEU_PHU_OFF_ACTION_REQUEST, SELECT_TO_ANSWER, selectedIndexAnswer);
				} else {
					isOk = true;
					isAnswered = false;
				}*/
				/*STATE_QUESTION = 0;
				isActiveHelp = false;
				selectedHelpIndex = 0;*/
			}
		} else if (isEndGame){ 
			DownloadResourceListener downloadResourceListener = new DownloadResourceListener(Constants.AI_LA_TRIEU_PHU_IMAGE_CATEGORY);
	        downloadResourceListener.nextForm = FrmAilaTrieuPhuOff.instance();
	        Global.authenticateHandle.addListener(downloadResourceListener);
	        GameGlobal.nextState(FrmDownloadResource.instance(), null);
	        isEndGame = false;
		}
		break;
	case Key.SOFT_LEFT:
		selectedHelpIndex = 0;
		isActiveHelp = !isActiveHelp;
			indexHelp = 0;
		break;
	default:
		break;
	}
  }

  public void onConnectDone() {
  }

  public void onConnectFail() {
  }

  public void onDisconnect() {
  }

  private String[] split(String original,String separator) {
	    String[] nodes = new String[5];
	    // Parse nodes into vector
	    int index = original.indexOf(separator);
	    int dem = 0;
	    while(index >= 0) {
	    	if (dem < 5) {
	    		nodes[dem] = original.substring(0, index);
		        original = original.substring(index + separator.length());
		        index = original.indexOf(separator);
		        dem ++;
	    	}
	    }
	    // Get the last node
	    if (dem < 5) {
	    	 nodes[dem] = original;
	    }
	   return nodes;
	}
  public void alertEventPerform(int alertType, int eventType, int alertId) {
	    // Khi người chơi nạp điểm
	    if (alertId == 99) {
	      if (eventType == 0) {
	        FrmGroupNapXuAndExchangeGold.backForm = FrmGroupMenu.instance();
	        Global.nextState(FrmGroupNapXuAndExchangeGold.instance(), null);
	      } else if (eventType == 1) {
	        FrmGroupNapXuAndExchangeGold.backForm = FrmGroupMenu.instance();
	        Global.nextState(FrmGroupNapXuAndExchangeGold.instance(), null);
	        FrmGroupNapXuAndExchangeGold.setTab(1);
	      } else {
	       FrmGroupMenu.tabIndex = 1;
	    	 Global.nextState(FrmGroupMenu.instance(), null);
	      }
	    }
	  }
  
  public void onRecieveDataProcess(DataPackage dataPackage) {
	  int header = dataPackage.nextInt();
	    switch (header) {
	    case KHONG_DU_TIEN_SIGNAL:
	    	GameGlobal.alert.showCustomButtonAlert1(this, StringArray.create2("Nạp tiền", "Đổi gold", "Trở về"), GameAlert.BUTTON_WIDTH_LARGE, StringArray.create1("Bạn không đủ gold để vào bàn", "Bạn cần nạp thêm gold!"), 99, GameAlert.VERTICAL_ALINE);
	    	STATE_SCREEN = 4;
	    	break;
	    case SEND_QUESTION:
	    	isAnswered = false;
	    	STATE_SCREEN = 1;
	    	resultHelpString = "";
	    	for (int i = 0;  i < 4; i++) {
	    		iscancel[i] = false;
	    	}
	    	question = new Question();
	    	String s = dataPackage.nextString();
	    	String[] data = split(s, "@@@");
	    	question.setContent(data[0]);
	    	question.setResult1(data[1]);
	    	question.setResult2(data[2]);
	    	question.setResult3(data[3]);
	    	question.setResult4(data[4]);
	    	if ("null".equals(question.getContent().trim()) || question.getContent() == null) {
	    		isErrorData = true;
	    	}
	    	timePerQuestion = 0;
	    	break;
	    case SEND_RESULT_AFTER_ANSWER:
    		final int sc = dataPackage.nextInt();
    		dapAnDung = dataPackage.nextString();
    		if (sc == 0) {
    		  isShowResultPerQuestion = true;
    			new GameControl() {
  					public void perform() {
							isNotTrue = true;
							isShowResultPerQuestion = false;
							STATE_SCREEN = 3;
							isEndGame = true;
					}
				}.setTimeInterval(2000).start();
    			
    		} else {
    		  isShowResultPerQuestion = true;
    			new GameControl() {
  					public void perform() {
  						obtainScores +=  sc;
  						
  						if (level < 15)
  			    			level ++;
  			    			STATE_SCREEN = 2;
  			    			isShowResultPerQuestion = false;
  					}
				}.setTimeInterval(2000).start();
    		}
	    	break;
	    case TRO_GIUP_50:
	    	resultHelpString = dataPackage.nextString();
	    	String[] str = split(resultHelpString, "|");
	    	int a = NumberUtil.parseInt(str[0]);
	    	iscancel[a] = true;
	    	int b = NumberUtil.parseInt(str[1]);
	    	iscancel[b] = true;
	    	break;
	    case TRO_GIUP_HOI_KHAN_GIA:
	    	resultHelpString = dataPackage.nextString();
	    	int[] x = new int[3];
	    	 int xx = dataPackage.nextInt();
	    	 x[0] = dataPackage.nextInt();
	    	 x[1] = dataPackage.nextInt();
	    	 x[2] = dataPackage.nextInt();
	    	for (int i = 0; i < 4; i ++) {
	    		percent[i] = 0;
	    		if (resultHelpString.trim().toUpperCase().equals(results[i])) {
	    			percent[i] = xx;
	    		} 
	    	}
	    	int count1 = 0;
	    	for (int i = 0; i < 4; i ++) {
	    			if (percent[i] == 0) {
	    				percent[i] = x[count1];
	    				count1 ++;
	    			}
	    	}
	    	break;
	    case TRO_GIUP_NGUOI_THAN:
	    	resultHelpString = dataPackage.nextString();
	    	break;
	    }
	    
  }
  
  private void sendMessageAction(int header, int header1, int data) {
	    DataPackage dataPackage = DataPackage.createDataPackage1(header);
		    dataPackage.putInt(header1);
		    dataPackage.putInt(data);
		    Global.gameActionClient.write(dataPackage);
	  }

public void doTask() {
	count = (count + 1) %2000;
	if (!isErrorData)  {
		if (count % 10 == 0) {
			if (isAnswered) {
				
			} else {
				if (STATE_SCREEN == 1) {
					isSendRequest = false;
					if (timePerQuestion >= 25) {
						isEndGame = true;
						STATE_SCREEN = 3;
					} else {
						timePerQuestion ++;
					}
				}
			}
			
			if (STATE_SCREEN == 2) {
				if (!isSendRequest) {
					sendRequestQuestion();
					isSendRequest = true;
				}
			}
			if (STATE_QUESTION == 21 || STATE_QUESTION == 23) {
				countDrawHelp1 = (countDrawHelp1 + 1) % 500;
			}
		}
	}
  }

	public void destroy() {
		text = null;
		question = null;
		backgroundImg = null;
		questionsBoxImg = null;
		menulevel = null;
		iconTrieuphuImg = null;
		linetop2Img = null;
		questionBoxImg = null;
		answerBoxImg = null;
		anseredBoxImg = null;
		hoi_khan_gia_Img = null;
		goidien_supportImg = null;
		half_supportImg = null;
		help_friends_bg = null;
		papaImg = null;
		mamaImg = null;
		hangxomImg = null;
		anhzaiImg = null;
		kuemImg = null;
		chigaiImg = null;
		endgameImg = null;
		buttonImg = null;
		buttonImg1 = null;
		boxYKienKhanGiaImg = null;
		confirmAnswerImg = null;
		chuXImg = null;
		results = null;
		resultHelpString = null;
		isUsedHelp = null;
		dapAnDung = null;
		iscancel = null;
		percent = null;
		nguoiThans = null;
		timeAreaImg = null;
		halfFocusImg = null;
	}

}
